<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws.
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/modules/Admin/classes/PhpFox_ComponentSystemCheck.class.php, $Author:  $ */



/** Component for displaying site warnings
 *
 *
 * @version $Id: PhpFox_ComponentSystemCheck.class.php 186 2008-01-20 01:53:56Z phpfoxsv $
 * @package module.admin
 */
class PhpFox_Mod_Admin_ComponentSystemCheck extends BaseComponent
{
    /** Process
     */
    function process()
    {
        $oSrvAdmin = $this->_oModule->getService('Admin');
        /* @var $oSrvAdmin PhpFox_Mod_Admin_ServiceAdmin */

        $oReq = &App::getRequest();

        if ( $sWarning = $oReq->get('warning') )
        {
			($sWarning == 'off' ? setcookie("phpfox_no_warning", time(), time()+3600*24*365, "/") : setcookie("phpfox_no_warning", "", -1, "/"));
			App::gotoUrl('admin.frames.main', array('reload' => 'left'));
        }

        switch ($oReq->getAction())
        {
            case 'purge_old_users':
                $oSrvAcc = &App::getModuleService('Account', 'Account');
                /* @var $oSrvAcc PhpFox_Mod_Account_ServiceAccount */
                $oSrvAcc->purgePendingTooMuchAccounts();
                $oUrl = App::getUrl();
                $oUrl->clearParams('act');
                App::forward($oUrl->getUrl());
                break;
        }

        $oPurgeUrl = App::getUrl();
        $oPurgeUrl->setParam('act', 'purge_old_users');
        $oTpl = &$this->_oModule->getTemplate();
        $oTpl->assignSrc(array(
            'aWarnings' => (App::getUser('type') == '0' ? $oSrvAdmin->getSiteWarnings($oPurgeUrl->getUrl()) : '')
        ));
        return $oTpl->fetch('SystemCheck.html');
    }
}
?>